<%--
  Created by IntelliJ IDEA.
  User: JMS
  Date: 2020/12/25
  Time: 20:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>报修中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- Bootstrap Styles-->
    <link rel="stylesheet" href="../../static/bootstrap/css/bootstrap.css" />
    <!-- FontAwesome Styles-->
    <link rel="stylesheet" href="../../static/font-awesome-4.7.0/css/font-awesome.css" />
    <link rel="stylesheet" href="../../static/font-awesome-4.7.0/css/custom-styles.css" />
    <link rel="stylesheet" href="../../static/css/style_x.css">
    <style type="text/css">
        .repair_form{
            margin-top:80px;
        }
        .form-title{
            text-align: center;
        }
    </style>
    <script src="../../static/bootstrap/jquery-3.5.1.min.js"></script>
    <script language="JavaScript" type="text/javascript">
        function Validate() {
            if ($("#Repair_project").val() == "") {
                document.getElementById("Repair_project").placeholder="此项为必填项";
                document.getElementById("Repair_project").style="border-color: red";
                $("#Repair_project").focus();
                return false;
            }
            if ($("#housing_estate").val() == "") {
                document.getElementById("housing_estate").placeholder="此项为必填项";
                document.getElementById("housing_estate").style="border-color: red";
                $("#housing_estate").focus();
                return false;
            }if ($("#address").val() == "") {
                document.getElementById("address").placeholder="此项为必填项";
                document.getElementById("address").style="border-color: red";
                $("#address").focus();
                return false;
            }if ($("#phone").val() == "") {
                document.getElementById("phone").placeholder="此项为必填项";
                document.getElementById("phone").style="border-color: red";
                $("#phone").focus();
                return false;
            }if ($("#quest_people").val() == "") {
                document.getElementById("quest_people").placeholder="此项为必填项";
                document.getElementById("quest_people").style="border-color: red";
                $("#quest_people").focus();
                return false;
            }if ($("#description").val() == "") {
                document.getElementById("description").placeholder="此项为必填项";
                document.getElementById("description").style="border-color: red";
                $("#description").focus();
                return false;
            }
            $("#repair_form").submit();
        }
    </script>
</head>
<body>
<!--/. NAV TOP  -->
<div class="row">
    <div class="col-2 ">
        <div id="wrapper">
            <nav class="top-navbar">
                <div class="navbar-header">
                    <a href="../../pages/user/userIndex.jsp">
                        <strong class="navbar-brand">住户功能菜单</strong>
                    </a>
                </div>
            </nav>
        </div>
        <nav class="navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                    <li>
                        <a href="Rental_center.jsp"><i class="fa fa-dashboard"></i> 租赁中心</a>
                    </li>
                    <li class="active-menu">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-caret-right" viewBox="0 0 16 16">
                            <path fill-rule="evenodd"
                                  d="M6 12.796L11.481 8 6 3.204v9.592zm.659.753l5.48-4.796a1 1 0 0 0 0-1.506L6.66 2.451C6.011 1.885 5 2.345 5 3.204v9.592a1 1 0 0 0 1.659.753z" />
                        </svg>
                        <a href="Report_repair.jsp"><i class="fa fa-desktop"></i> 报事报修</a>
                    </li>
                    <li>
                        <a href="getContract.jsp"><i class="fa fa-bar-chart-o"></i> 结算中心</a>
                    </li>
                    <li>
                        <a href="Public_weekly.jsp"><i class="fa fa-qrcode"></i> 公共周刊</a>
                    </li>
                    <li>
                        <a href="Party_building_activities.jsp"><i class="fa fa-history" aria-hidden="true"></i> 党建活动</a>
                    </li>
                </ul>
            </div>

        </nav>
    </div>
    <!-- /. NAV SIDE  -->
    <div class="col-10" style="height: 800px; background: #fff;">
        <div class="repair_form md-5">
            <h3 class="form-title">维修单</h3>
            <div class="container form-body">
                <div class="row">
                    <div class="col-6 offset-3">
                        <form action="/insertRepair" method="post" id="repair_form">
                            <input type="hidden" name="userId" value="${sessionScope.user.userId}">
                            <div class="form-group">
                                <label for="Repair_project" class="form-label">维修项目</label>
                                <input type="text" name="repair_project" class="form-control" id="Repair_project" placeholder="维修项目">
                            </div>
                            <div class="form-group">
                                <label for="housing_estate" class="form-label">小区</label>
                                <input type="text" name="housing_estate" class="form-control" id="housing_estate" placeholder="小区">
                            </div>
                            <div class="form-group">
                                <label for="address" class="form-label">地址</label>
                                <input type="text" name="address" class="form-control" id="address" placeholder="地址">
                            </div>
                            <div class="form-group">
                                <label for="phone" class="form-label">电话</label>
                                <input type="text" name="phone" class="form-control" id="phone" placeholder="电话">
                            </div>
                            <div class="form-group">
                                <div class="form-row">
                                    <div class="col-6">
                                        <label for="quest_people" class="form-label">报修人</label>
                                        <input type="text" name="request_people" class="form-control" id="quest_people" placeholder="报修人">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="description" class="form-label">描述</label>
                                <textarea class="form-control" name="description" id="description" rows="3"></textarea>
                            </div>
                            <div>
                                <button type="button" class="btn btn-primary" onclick="Validate()">提交</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>